<?php
session_start();
include_once('includes/db.php');
include_once('paginate.php');

function menu()
{
?>	
	<li><a href='#'>Home</a></li>
<?php	
}
?>

<?php
include_once('header.php');
$page=new paginator("SELECT * FROM `article`",2);
$result=$page->paginate_query();
//$str="SELECT * FROM `article` limit $curr,2";
//$result=mysql_query($str);
$num=mysql_num_rows($result);
for($i=0;$i<$num;$i++)
{
	$row=mysql_fetch_array($result);
	echo "<h2>".$row['title']."</h2>";
	$post=substr($row['article'],0,200);
	echo $post."&nbsp;&nbsp;";
	echo "<a href='post.php?id=".$row['id']."'>Read more</a>";	
}
$page->paginate_show();
echo "<br/>";
include_once('footer.php');
?>